package com.xwzn.resident;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

/**
 * @Description  轮播图的详细信息展示
 * @Author HanKaiYang
 * @CreateDate 2019-12-23 10:55
 * @Version 1.0
 */
public class BannerActivity extends AppCompatActivity {


    private ImageView ivTitleBack;
    private TextView tvBannerTitle;
    private TextView tvBannerDate;
    private ImageView ivBannerImage;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_banner);
        initView();
    }

    /**
     * 初始化视图
     * @author HanKaiYang
     * @createDate 2019/12/23 10:57
     */
    private void initView() {
        tvBannerTitle = (TextView) findViewById(R.id.tv_banner_title);
        tvBannerDate = (TextView) findViewById(R.id.tv_banner_date);
        ivBannerImage = (ImageView) findViewById(R.id.iv_banner_image);
        //返回
        ivTitleBack = findViewById(R.id.iv_title_back);
        ivTitleBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });

        ivBannerImage.setBackgroundResource(getIntent().getIntExtra("image",0));
        tvBannerTitle.setText(getIntent().getStringExtra("title"));
        tvBannerDate.setText(getIntent().getStringExtra("date"));
    }
}
